﻿@model ESupervision.ViewModels.DashboardSumarising

@{
    ViewBag.Title = "Student Sumarising Dashboard";
}
<h2>Student Summarising Dashboard</h2>

<div class="row">
    <div class="col-xs-4">
        <div class="btn-group">
            <button type="button" class="btn btn-warning dropdown-toggle btn-lg" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-envelope" /> Messages <span class="badge">@(Model.TotalInboxMessages + Model.TotalSentMessages)</span><span class="caret"></span></button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="@Url.Action("Sent", "Message")">Sent messages <span class="badge">@Model.TotalSentMessages</span></a></li>
                <li class="divider"></li>
                <li><a href="@Url.Action("Index", "Message")">Received messages <span class="badge">@Model.TotalInboxMessages</span></a></li>
            </ul>
        </div>
    </div>
    <div class="col-xs-4">
        <div class="btn-group">
            <button type="button" class="btn btn-success dropdown-toggle btn-lg" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-book" /> Documents <span class="badge">@(Model.TotalUploadedFiles + Model.TotalComments)</span> <span class="caret"></span></button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="@Url.Action("Index", "Document")">Uploaded Files <span class="badge">@Model.TotalUploadedFiles</span></a></li>
                <li class="divider"></li>
                <li><a href="@Url.Action("Index", "Document")">Comments <span class="badge">@Model.TotalComments</span></a></li>
            </ul>
        </div>
    </div>
    <div class="col-xs-4">
        <div class="btn-group">
            <button type="button" class="btn btn-primary dropdown-toggle btn-lg" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon glyphicon-user" /> Meetings <span class="badge">@Model.TotalRequestedMeetings</span> <span class="caret"></span></button>
            <ul class="dropdown-menu" role="menu">
                <li><a href="@Url.Action("Index", "Meeting")">Requested Meetings <span class="badge">@Model.TotalRequestedMeetings</span></a></li>
            </ul>
        </div>
    </div>
</div>
<div class="row" style="margin:30px 0;">
    <div class="panel panel-warning">
        <div class="panel-heading">
            <h3 class="panel-title" id="panel-title">Information about Student<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-2"><b>First Name:</b></div>
                <div class="col-md-4">@Model.StaticStudent.FirstName</div>
                <div class="col-md-2"><b>Last Name:</b></div>
                <div class="col-md-4">@Model.StaticStudent.LastName</div>
            </div>
            <div class="row">
                <div class="col-md-2"><b>Full Name:</b></div>
                <div class="col-md-4">@Model.StaticStudent.FullName</div>
                <div class="col-md-2"><b>Birthday:</b></div>
                <div class="col-md-4">@Model.StaticStudent.Birthday.ToShortDateString()</div>
            </div>
            <div class="row">
                <div class="col-md-2"><b>Phone:</b></div>
                <div class="col-md-4">@Model.StaticStudent.FirstName</div>
                <div class="col-md-2"><b>Email:</b></div>
                <div class="col-md-4"><a href="mailto:@Model.StaticStudent.Email">@Model.StaticStudent.Email</a></div>
            </div>
            <div class="row">
                <div class="col-md-2"><b>Staff Enrollment:</b></div>
                <div class="col-md-4">@Model.StaticStudent.AuthorisedStaff.FullName</div>
                <div class="col-md-2"><b>Enrollment Date:</b></div>
                <div class="col-md-4">@Model.StaticStudent.EnrollmentDate</div>
            </div>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-md-6">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title" id="panel-title">Student Supervision<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
            </div>
            <div class="panel-body">
                <div role="tabpanel">

                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#Superprofile" aria-controls="Superprofile" role="tab" data-toggle="tab">Profile</a></li>
                        <li role="presentation"><a href="#Supermessages" aria-controls="Supermessages" role="tab" data-toggle="tab">Messages</a></li>
                        <li role="presentation"><a href="#Superdocument" aria-controls="Superdocument" role="tab" data-toggle="tab">Documents</a></li>
                        <li role="presentation"><a href="#Supermeeting" aria-controls="Supermeeting" role="tab" data-toggle="tab">Meetings</a></li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane active" id="Superprofile">
                            <div class="list-group">
                                <a href="#" class="list-group-item">
                                    <strong>First name: </strong>@Model.StaticStudent.Supervisor.FirstName
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Full name: </strong>@Model.StaticStudent.Supervisor.FullName
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Birthday: </strong>@Model.StaticStudent.Supervisor.Birthday.ToShortDateString()
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Phone: </strong>@Model.StaticStudent.Supervisor.Phone
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Email: </strong>@Model.StaticStudent.Supervisor.Email
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Address: </strong>@Model.StaticStudent.Supervisor.Address
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Hiren Date: </strong>@Model.StaticStudent.Supervisor.HireDate.ToShortDateString()
                                </a>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="Supermessages">
                            <div class="list-group">
                                @foreach (var item in Model.Convertions)
                                {
                                    if (item.messageSent.SentUserID == Model.StaticStudent.Id)
                                    {

                                        if (item.messageSent.MessageStatus == ESupervision.Models.MessageStatus.Unread)
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, sId = item.messageSent.MessageSentID })" class="list-group-item">
                                                <b>@item.message.Subject</b> <span class="badge">Sent Message</span>
                                            </a>
                                        }
                                        else
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, sId = item.messageSent.MessageSentID })" class="list-group-item">
                                                @item.message.Subject <span class="badge">Sent Message</span>
                                            </a>
                                        }
                                    }
                                    else
                                    {
                                        if (item.messageRecipient.MessageStatus == ESupervision.Models.MessageStatus.Unread)
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, rId = item.messageRecipient.MessageRecipientID })" class="list-group-item">
                                                <b>@item.message.Subject</b> <span class="badge">Received Message</span>
                                            </a>
                                        }
                                        else
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, rId = item.messageRecipient.MessageRecipientID })" class="list-group-item">
                                                @item.message.Subject <span class="badge">Received Message</span>
                                            </a>
                                        }
                                    }
                                }
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="Superdocument">
                            <div class="list-group">
                                @foreach (var item in Model.Uploadedfiles)
                                {
                                    <a href="@Url.Action("Details", "Document", new { id =item.DocumentID})" class="list-group-item">
                                        @item.Subject
                                        @if (item.Comments.Count > 0 && item.Comments.Last().CommentTime > DateTime.Now.AddDays(-1))
                                        {
                                            <span class="badge">New Uploaded File And Comments</span>
                                        }
                                        else
                                        {
                                            <span class="badge">New Uploaded File</span>
                                        }
                                    </a>
                                }
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="Supermeeting">
                            @foreach (var item in Model.RequestedMeetings)
                            {
                                <a href="@Url.Action("Details", "Meeting", new { id =item.MeetingEventID})" class="list-group-item">
                                    @item.Subject
                                    <span class="badge">New Requested Meeting</span>
                                </a>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-6">
        <div class="panel panel-danger">
            <div class="panel-heading">
                <h3 class="panel-title" id="panel-title">Student Second Marker<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
            </div>
            <div class="panel-body">
                <div role="tabpanel">

                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#SndMarkerprofile" aria-controls="SndMarkerprofile" role="tab" data-toggle="tab">Profile</a></li>
                        <li role="presentation"><a href="#SndMarkermessages" aria-controls="SndMarkermessages" role="tab" data-toggle="tab">Messages</a></li>
                        <li role="presentation"><a href="#SndMarkerdocument" aria-controls="SndMarkerdocument" role="tab" data-toggle="tab">Documents</a></li>
                        <li role="presentation"><a href="#SndMarkermeeting" aria-controls="SndMarkermeeting" role="tab" data-toggle="tab">Meetings</a></li>
                    </ul>

                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane active" id="SndMarkerprofile">
                            <div class="list-group">
                                <a href="#" class="list-group-item">
                                    <strong>First name: </strong>@Model.StaticStudent.SecondMarker.FirstName
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Full name: </strong>@Model.StaticStudent.SecondMarker.FullName
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Birthday: </strong>@Model.StaticStudent.SecondMarker.Birthday.ToShortDateString()
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Phone: </strong>@Model.StaticStudent.SecondMarker.Phone
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Email: </strong>@Model.StaticStudent.SecondMarker.Email
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Address: </strong>@Model.StaticStudent.SecondMarker.Address
                                </a>
                                <a href="#" class="list-group-item">
                                    <strong>Hiren Date: </strong>@Model.StaticStudent.SecondMarker.HireDate.ToShortDateString()
                                </a>
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="SndMarkermessages">
                            <div class="list-group">
                                @foreach (var item in Model.SMConvertions)
                                {
                                    if (item.messageSent.SentUserID == Model.StaticStudent.Id)
                                    {

                                        if (item.messageSent.MessageStatus == ESupervision.Models.MessageStatus.Unread)
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, sId = item.messageSent.MessageSentID })" class="list-group-item">
                                                <b>@item.message.Subject</b> <span class="badge">Sent Message</span>
                                            </a>
                                        }
                                        else
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, sId = item.messageSent.MessageSentID })" class="list-group-item">
                                                @item.message.Subject <span class="badge">Sent Message</span>
                                            </a>
                                        }
                                    }
                                    else
                                    {
                                        if (item.messageRecipient.MessageStatus == ESupervision.Models.MessageStatus.Unread)
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, rId = item.messageRecipient.MessageRecipientID })" class="list-group-item">
                                                <b>@item.message.Subject</b> <span class="badge">Received Message</span>
                                            </a>
                                        }
                                        else
                                        {
                                            <a href="@Url.Action("Read", "Message", new { id = item.message.ID, rId = item.messageRecipient.MessageRecipientID })" class="list-group-item">
                                                @item.message.Subject <span class="badge">Received Message</span>
                                            </a>
                                        }
                                    }
                                }
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="SndMarkerdocument">
                            <div class="list-group">
                                @foreach (var item in Model.SMUploadedfiles)
                                {
                                    <a href="@Url.Action("Details", "Document", new { id =item.DocumentID})" class="list-group-item">
                                        @item.Subject
                                        @if (item.Comments.Count > 0 && item.Comments.Last().CommentTime > DateTime.Now.AddDays(-1))
                                        {
                                            <span class="badge">New Uploaded File And Comments</span>
                                        }
                                        else
                                        {
                                            <span class="badge">New Uploaded File</span>
                                        }
                                    </a>
                                }
                            </div>
                        </div>
                        <div role="tabpanel" class="tab-pane" id="SndMarkermeeting">
                            @foreach (var item in Model.SMRequestedMeetings)
                            {
                                <a href="@Url.Action("Details", "Meeting", new { id =item.MeetingEventID})" class="list-group-item">
                                    @item.Subject
                                    <span class="badge">New Requested Meeting</span>
                                </a>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<p>
    @Html.ActionLink(" Back to list", "StaffDashboard", null, new { @class = "btn btn-success btn-sm glyphicon glyphicon-repeat" })
</p>
